<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="public/page_css::page_css ('查看任务明细(第一个页面)')" />

<body>
<section class="panel panel-padding layui-card-body">
    <div class="pro">
        <table id="table" class="table text-nowrap"></table>
    </div>
    <input type="hidden" class="layui-input" th:value="${sszjdid}" id="sszjdid"/>
</section>

</body>
<div th:include="public/public_js::public_js"></div>

<script th:inline="javascript">
    $(function () {
    })

</script>
<script>

    layui.use(['list', 'layer', 'zzpUtils', 'jquery', 'laydate'], function () {
        window.operateEvent = {
            "click .layui-btn-primary": function (e, value, row, index) {
                /*这里激活状态那个按钮用不到，啥都不需要写，只读*/
            },
            "click #lookQuality": function (e, value, row, index) {//行创建装车单
                lookQuality(row.id);
            }
        }
        var zzpUtils = layui.zzpUtils,
            $ = layui.jquery,
            laydate = layui.laydate;

        var $table = zzpUtils.table({
            elem: '#table',
            isApi: true,
            pagination:true,
            url: '/wmsqualityinspectionlistdetailed/list/'+$("#sszjdid").val(),
            columns: [
            {
                field: 'zjsf',
                title: '质检方式'
            },{
                field: 'goodsbh',
                title: '货品编号'
            },{
                field: 'goodsmc',
                title: '货品名称'
            },{
                field: 'bzmc',
                title: '包装名称'
            },  {
                field: 'dwmc',
                title: '单位名称',
                visible:false
            },{
                field: 'shsl',
                title: '收货数量',
                visible:false
            },{
                field: 'yjsl',
                title: '应检数量',
                visible:false
            },{
                field: 'show_zt',
                title: '质检状态',
                visible:false
            }, {
                field: 'pc',
                title: '批次',
                visible:false
            },{
                field: 'scrq',
                title: '生产日期',
                sortable: true,
                //——修改——获取日期列的值进行转换
                formatter: function (value, row, index) {
                    return changeDateFormat(value)
                },
                visible:false
            },{
                field: 'caozuo',
                title: '操作',
                events: operateEvent,
                formatter: operateFormatter
            }],
            queryParams: function () {//查询条件
                return  zzpUtils.getFormJson($("#searchForm"));
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            }
        });
        /*表格右侧按钮*/
        function operateFormatter(value, row, index) {
            return [
                '<a class="layui-btn layui-btn-xs" id="lookQuality">查看</a>'

            ].join('')
        }
        //查看入库质检详细明细
        function lookQuality(id) {
            layer.open({
                type: 2,
                area: ['80%', '80%'],
                content: "/zxsswms/qualityRouter/toChakanMxTwo?id=" + id
                ,cancel: function(){
                    //右上角关闭回调
                }
            });

        }

    });
    //修改——转换日期格式(时间戳转换为datetime格式)
    function changeDateFormat(cellval) {
        if (cellval != null) {
            return cellval.substr(0,19);
        }
    }


</script>
</html>